<?php

namespace app\api\model;

use think\Model;
use ba\random;
/**
 * 发码模型
*/
class GiftCode extends Model
{
    protected $autoWriteTimestamp = true;

    protected static function onBeforeInsert($model)
    {
        $model->gift_code = random::build('numeric',4);
    }

    
}